<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/8/23
 * Time: 14:12
 * 添加用户信息
 */
//获取参数
$ou_username              = $route->bodyParams['ou_username'];               //账号
$ou_password              = $route->bodyParams['ou_password'];               //密码
$ou_oesid                 = $route->bodyParams['ou_oesid'];                  //所属的企业结构节点位置
$ou_name                  = $route->bodyParams['ou_name'];                   //用户名称
$ou_phone                 = $route->bodyParams['ou_phone'];                  //手机号码
$ou_sex                   = $route->bodyParams['ou_sex'];                    //性别 0-男 1-女 2-保密
$ou_induction_time        = $route->bodyParams['ou_induction_time'];        //入职时间
$ou_type                  = $route->bodyParams['ou_type'];                            //员工类型
$ou_expire_time           = $route->bodyParams['ou_expire_time'];           //到期时间
$ou_status                = $route->bodyParams['ou_status'];                 //员工状态 0-正常 1-离职 2-禁用
$ou_organization_user_id  = $route->bodyParams['ou_organization_user_id']; //关联机构端员工id
$ou_salary  = $route->bodyParams['ou_salary']; //底薪
$ou_post_salary           = $regexpObj->bodyV($response,$route,'ou_post_salary','NORMAL');//岗位薪资
$ou_workage_salary        = $regexpObj->bodyV($response,$route,'ou_workage_salary','NORMAL');//工龄薪资
$ou_insurance_and_housing_fund = $regexpObj->bodyV($response,$route,'ou_insurance_and_housing_fund','NORMAL');//五险一金
$ou_update_reson          = $regexpObj->bodyV($response,$route,'ou_update_reson','NORMAL');//更新薪资理由
$ou_position          = $regexpObj->bodyV($response,$route,'ou_position','NORMAL');//更新薪资理由

//写入数组
$insertArr = [
    'ou_username'               => $ou_username,
    'ou_password'               => $ou_password,
    'ou_oesid'                  => $ou_oesid,
    'ou_name'                   => $ou_name,
    'ou_phone'                  => $ou_phone,
    'ou_sex'                    => $ou_sex,
    'ou_induction_time'         => $ou_induction_time,
    'ou_expire_time'            => $ou_expire_time,
    'ou_status'                 => $ou_status,
    'ou_type'                   => $ou_type,
    'ou_organization_user_id'   => $ou_organization_user_id,
    'ou_salary'                 => $ou_salary,
    'ou_post_salary'            => $ou_post_salary,
    'ou_workage_salary'         => $ou_workage_salary,
    'ou_insurance_and_housing_fund' => $ou_insurance_and_housing_fund,
    'ou_update_reson'           => $ou_update_reson,
    'ou_position'               => $ou_position,
];

//执行写入语句
$rsData = $db->mysqlDB->insert("oa_user",$insertArr);

//返回成功结果
$response->responseData( true, $rsData );